import React from 'react';

export interface IExpandOut {
  onClick?: () => void | Promise<void>;
  element?: React.ReactNode;
  loading?: Boolean;
}

export default interface ICapability<T = any> {
  /** 标识 */
  id: string;

  /** 显示名称 */
  title: string;

  /** 是否子菜单 */
  subMenu?: ICapability[];

  /** 是否启用 */
  isEnable?: (record: T, index: number) => boolean;

  /** 是否失效 */
  isDisabled?: (record: T, index: number) => boolean;

  /** 扩展 */
  useExpand: (record: T, index: number) => IExpandOut;
}

